home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Ebooks / Thinking in C++ V2 / C18 / Fullwrap.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-25  |  1.2 KB  |  46 lines

  1. //: C18:Fullwrap.h
  2. // From Thinking in C++, 2nd Edition
  3. // Available at http://www.BruceEckel.com
  4. // (c) Bruce Eckel 1999
  5. // Copyright notice in Copyright.txt
  6. // Completely hidden file IO
  7. #ifndef FULLWRAP_H
  8. #define FULLWRAP_H
  9.  
  10. class File {
  11.   std::FILE* f;
  12.   std::FILE* F(); // Produces checked pointer to f
  13. public:
  14.   File(); // Create object but don't open file
  15.   File(const char* path,
  16.        const char* mode = "r");
  17.   ~File();
  18.   int open(const char* path,
  19.            const char* mode = "r");
  20.   int reopen(const char* path,
  21.              const char* mode);
  22.   int getc();
  23.   int ungetc(int c);
  24.   int putc(int c);
  25.   int puts(const char* s);
  26.   char* gets(char* s, int n);
  27.   int printf(const char* format, ...);
  28.   size_t read(void* ptr, size_t size,
  29.               size_t n);
  30.   size_t write(const void* ptr,
  31.                 size_t size, size_t n);
  32.   int eof();
  33.   int close();
  34.   int flush();
  35.   int seek(long offset, int whence);
  36.   int getpos(fpos_t* pos);
  37.   int setpos(const fpos_t* pos);
  38.   long tell();
  39.   void rewind();
  40.   void setbuf(char* buf);
  41.   int setvbuf(char* buf, int type, size_t sz);
  42.   int error();
  43.   void clearErr();
  44. };
  45. #endif // FULLWRAP_H ///:~
  46.